package c.c.c.a.g;

import java.lang.Thread.UncaughtExceptionHandler;
import java.util.HashSet;
import java.util.Iterator;

/* compiled from: CrashCatchDispatcher */
public class b implements UncaughtExceptionHandler {
    public static b e;
    public UncaughtExceptionHandler a;
    public HashSet<UncaughtExceptionHandler> b = new HashSet();
    public c c;
    public long d = -1;

    public b() {
        a();
        try {
            new a(this).start();
        } catch (Throwable unused) {
        }
    }

    public final void a() {
        b defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
        if (defaultUncaughtExceptionHandler != this) {
            Thread.setDefaultUncaughtExceptionHandler(this);
            if (this.a == null) {
                this.a = defaultUncaughtExceptionHandler;
            } else {
                this.b.add(defaultUncaughtExceptionHandler);
            }
        }
    }

    public final void b(Thread thread, Throwable th) {
        try {
            Iterator it = this.b.iterator();
            while (it.hasNext()) {
                try {
                    ((UncaughtExceptionHandler) it.next()).uncaughtException(thread, th);
                } catch (Throwable unused) {
                }
            }
            this.a.uncaughtException(thread, th);
        } catch (Throwable unused2) {
        }
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:30:0x0075 */
    /* JADX WARNING: Missing exception handler attribute for start block: B:24:0x004b */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Can't wrap try/catch for region: R(3:24|25|40) */
    /* JADX WARNING: Missing block: B:25:?, code skipped:
            r5 = c.c.c.a.n.a;
            r5 = c.c.c.a.n.d;
     */
    /* JADX WARNING: Missing block: B:31:?, code skipped:
            r0 = c.c.c.a.n.a;
            r0 = c.c.c.a.n.d;
     */
    /* JADX WARNING: Missing block: B:35:0x007e, code skipped:
            b(r8, r9);
     */
    public void uncaughtException(java.lang.Thread r8, java.lang.Throwable r9) {
        /*
        r7 = this;
        r0 = android.os.SystemClock.uptimeMillis();
        r2 = r7.d;
        r0 = r0 - r2;
        r2 = 20000; // 0x4e20 float:2.8026E-41 double:9.8813E-320;
        r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));
        if (r4 >= 0) goto L_0x000e;
    L_0x000d:
        return;
    L_0x000e:
        r0 = java.lang.System.currentTimeMillis();
        r2 = android.os.SystemClock.uptimeMillis();	 Catch:{ all -> 0x0075 }
        r7.d = r2;	 Catch:{ all -> 0x0075 }
        r2 = c.c.c.a.n.e;	 Catch:{ all -> 0x0075 }
        r2 = r2.e;	 Catch:{ all -> 0x0075 }
        r3 = 1;
        if (r2 == 0) goto L_0x0027;
    L_0x001f:
        r2 = r2.a(r9, r8);	 Catch:{ all -> 0x0027 }
        if (r2 == 0) goto L_0x0026;
    L_0x0025:
        goto L_0x0027;
    L_0x0026:
        r3 = 0;
    L_0x0027:
        if (r3 != 0) goto L_0x002d;
    L_0x0029:
        r7.b(r8, r9);
        return;
    L_0x002d:
        r2 = c.c.c.a.f.JAVA;	 Catch:{ all -> 0x0075 }
        r4 = c.c.c.a.n.e;	 Catch:{ all -> 0x0075 }
        r4 = r4.c;	 Catch:{ all -> 0x0075 }
        r4 = r4.iterator();	 Catch:{ all -> 0x0075 }
    L_0x0037:
        r5 = r4.hasNext();	 Catch:{ all -> 0x0075 }
        if (r5 == 0) goto L_0x0050;
    L_0x003d:
        r5 = r4.next();	 Catch:{ all -> 0x0075 }
        r5 = (c.c.c.a.j) r5;	 Catch:{ all -> 0x0075 }
        r6 = b.i.b.f.k(r9);	 Catch:{ all -> 0x004b }
        r5.a(r2, r6, r8);	 Catch:{ all -> 0x004b }
        goto L_0x0037;
    L_0x004b:
        r5 = c.c.c.a.n.a;	 Catch:{ all -> 0x0075 }
        r5 = c.c.c.a.n.d;	 Catch:{ all -> 0x0075 }
        goto L_0x0037;
    L_0x0050:
        if (r3 == 0) goto L_0x0079;
    L_0x0052:
        r2 = r7.c;	 Catch:{ all -> 0x0075 }
        if (r2 == 0) goto L_0x0079;
    L_0x0056:
        java.util.Objects.requireNonNull(r2);	 Catch:{ all -> 0x0075 }
        r2 = r7.c;	 Catch:{ all -> 0x0075 }
        r2.a(r0, r8, r9);	 Catch:{ all -> 0x0075 }
        r0 = "crash_dispatcher";
        r1 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0075 }
        r1.<init>();	 Catch:{ all -> 0x0075 }
        r2 = "end dispose ";
        r1.append(r2);	 Catch:{ all -> 0x0075 }
        r1.append(r9);	 Catch:{ all -> 0x0075 }
        r1 = r1.toString();	 Catch:{ all -> 0x0075 }
        android.util.Log.i(r0, r1);	 Catch:{ all -> 0x0075 }
        goto L_0x0079;
    L_0x0075:
        r0 = c.c.c.a.n.a;	 Catch:{ all -> 0x007d }
        r0 = c.c.c.a.n.d;	 Catch:{ all -> 0x007d }
    L_0x0079:
        r7.b(r8, r9);
        return;
    L_0x007d:
        r0 = move-exception;
        r7.b(r8, r9);
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.g.b.uncaughtException(java.lang.Thread, java.lang.Throwable):void");
    }
}
